<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::group(['domain'=>env('FRONT_DOMAIN'),'middleware' => ['web'] ],function($router){

    //微信
    Route::group(['prefix'=>"wechat"],function(){
        Route::any('', 'WechatController@serve');

        Route::any('/pay', 'WechatController@pay')->name('wechat.pay');
        Route::any('/callback', 'WechatController@callback')->name('wechat.payCallback');

        Route::any('/menu', 'WechatController@createMenu')->name('wechat.createMenu');

        Route::get('/info', 'WechatController@userInfo')->name('wechat.userinfo');

        //分享
        Route::get('/share','WechatController@share')->name('wechat.share');
    });



    //api

    Route::group(['prefix'=>"api",'namespace'=>'Api'],function(){
        Route::get('/pay','WechatController@wechatPay')->name('api.weichat.pay');
    });

});

Route::get('/testing/config','TestController@config')->name('testing.config');
Route::get('/testing/goto','TestController@gotoConfig')->name('testing.goto');
Route::get('/testing/sync/order','TestController@testSyncUserOrderInfo')->name('test.sysc.order');
Route::get('/testing/encode/id','TestController@encodeId')->name('test.encode.id');



Route::any('/terrace/sysmessage','TerraceController@sysmessage')->name('terrace');